import { createRouter, createWebHistory } from 'vue-router';
import HomeWork from '../views/HomeWork.vue';
import Login from '../views/Login.vue';
import WorksShowView from '../views/WorksShowView.vue';
import DoHomeworkView from "@/views/DoHomeworkView.vue";
import AddWork from '../views/AddWork.vue';
import WorkDetail from '../views/WorkDetail.vue';
import UpdateWork from '../views/UpdateWork.vue';

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      name: 'login',
      component: Login,
    },
    {
      path: '/list',
      name: 'homeWorklist',
      component: HomeWork,
    },
    {
      path:'/addwork',
      name:'addwork',
      component: AddWork
    },
    {
      path: '/show',
      name: 'workshow',
      component: WorksShowView
    },
    {
      path:'/doWork/:id?/:sub?',
      name:'doWork',
      component: DoHomeworkView
    },
    {
      path:'/workdetail/:id',
      name:'workdetail',
      component: WorkDetail
    },
    {
      path:'/updatework/:id',
      name:'updatework',
      component: UpdateWork
    }
  ]
})

export default router
